angular.module('Controller')

.controller 'NewsActivityDetailCtrl', ($scope, $state, menuManage, commonUtil, userData, $localStorage, commonConstant, wfAlert, $http) ->
    console.log "NewsActivityDetailCtrl"
    $scope.$storage = $localStorage
    $scope.currentId=$state.params.childId
    $scope.subMenus= [
        {
            name: "公司新闻"
            type: "subPage"
            route: "news-activity"
            id: 0
        }
        {
            name: "新品到货"
            type: "subPage"
            route: "news-activity"
            id: 1
        }
        {
            name: "行业新闻"
            type: "subPage"
            route: "news-activity"
            id: 2
        }
        {
            name: "活动信息"
            type: "subPage"
            route: "news-activity"
            id: 3
        }
    ]
    $scope.clickSubMenu=(id)->
        $state.go('news-activity',{childId:id})
    console.log $localStorage.currentNews
    $('html, body').animate({
        scrollTop: $("#header").offset().top
    }, 100);
    $http.put("/wainNews/#{$localStorage.currentNews.id}")


